<!DOCTYPE htm PUBLIC "-//W3C//DTD Xhtm 1.0 Transitional//EN" "DTD/xhtm1-transitional.dtd"> 
<htm xmlns="http://www.w3.org/1999/xhtm" xml:lang="de" lang="de">
<head>
 <meta http-equiv="content-type" content="text/htm; charset=iso-8859-1" />
 <meta http-equiv="content-style-type" content="text/css" />
 <meta name="author" content="Arlsair" />
 <meta name="date" content="2004-01-22" />
 <title>MipSmooth</title>
 <link rel="stylesheet" type="text/css" href="../../style.css" />
</head><body>
<h1>MipSmooth</h1>

<h2>&Uuml;bersicht</h2>
<b>Autor:</b> Klaus Post (Sh0dan)<br />
<b>Version:</b> 1.11<br />
<b>Download:</b> <a href="http://cultact-server.novi.dk/kpo/avisynth/mipsmooth.html" target="_blank">http://cultact-server.novi.dk/kpo/avisynth/mipsmooth.html</a><br />
<b>Kategorie:</b> R&auml;umlich-Zeitlicher Weichzeichner<br />
<b>Anforderungen:</b>
<ul>
  <li>YV12, YUY2 oder RGB Farbformat</li>
  <li>SSEMMX (=ISSE) f&auml;hige CPU</li>
  <li>Die Breite muss duch 4 (YV12) bzw. 8 (YUY2) teilbar sein</li>
</ul>
<hr size=2 width="100%" align=center>

<!-- #EndTemplate -->
<h2>Description:</h2>
<p>
<span style="font-family: helvetica,arial,sans-serif;">This is the MipSmoother -
a reinvention of SmoothHiQ and Convolution3D. MipSmooth was made to enable
smoothing of larger pixel areas than 3x3(x3), to remove blocks and smoothing out
low-frequency noise.</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">It is my hope that when
this filter has been tweaked it will be better than C3D at smoothing out flat
surfaces and gradients. This should be good for cartoons/anime, but it actually
also helps film footage quite nicely.</span><br style="font-family: helvetica,arial,sans-serif;">
</p>
<h2><small>Syntax:</small></h2>
<p><span style="font-family: helvetica,arial,sans-serif;">Basic syntax: </span><span style="font-weight: bold; font-family: helvetica,arial,sans-serif;">MipSmooth()</span><span style="font-family: helvetica,arial,sans-serif;">
- all parameters are optional.</span><br style="font-family: helvetica,arial,sans-serif;">
<br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">Extended syntax:</span><br style="font-family: helvetica,arial,sans-serif;">
<br style="font-family: helvetica,arial,sans-serif;">
<span style="font-weight: bold; font-family: helvetica,arial,sans-serif;">MipSmooth([clip],[optional
arguments])</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">There are a number of
arguments that control how much smoothing will be applied:</span><br style="font-family: helvetica,arial,sans-serif;">
<br style="font-family: helvetica,arial,sans-serif;">
<span style="font-weight: bold; font-family: helvetica,arial,sans-serif;">preset
= &quot;MovieHQ&quot; / &quot;MovieLQ&quot; / &quot;AnimeHQ&quot; /
&quot;AnimeLQ&quot; / &quot;VHS&quot; / &quot;Rainbow&quot; / &quot;Custom&quot;</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">Loads a built-in preset
as new defaults. See the preset section for more information.</span><br style="font-family: helvetica,arial,sans-serif;">
<br style="font-family: helvetica,arial,sans-serif;">
<span style="font-weight: bold; font-family: helvetica,arial,sans-serif;">spatial
= 5,<br>
temporal = 4,<br>
spatial_chroma =6,<br>
temporal_chroma =54,<br>
scenechange = 2.0</span><br style="font-family: helvetica,arial,sans-serif;">
<br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">All numbers are valid in
the ranges 0 - 255 and this defines the threshold for each mode of blending.</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">The thresholds can be
compared to the ones of C3D, except higher thresholds smooth much less than C3D.</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">The default settings are
quite conservative, and only slightly smooths out surfaces.</span><br style="font-family: helvetica,arial,sans-serif;">
<br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">&quot;Temporal
influence&quot; is replaced by overall scenechange detection.&nbsp; Scenechanges
will disable temporal processing in either direction. Use &quot;show =
true&quot; to display the values on each frame.</span><br style="font-family: helvetica,arial,sans-serif;">
<br style="font-family: helvetica,arial,sans-serif;">
<span style="font-weight: bold; font-family: helvetica,arial,sans-serif;">method&nbsp;
= &quot;strong&quot; / &quot;soft&quot; /&nbsp; &quot;supersoft&quot; /
&quot;superstrong&quot;&nbsp; </span><span style="font-style: italic; font-family: helvetica,arial,sans-serif;">-
default: &quot;supersoft&quot;</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">This setting controls how
much blurring is applied. The </span><span style="font-style: italic; font-family: helvetica,arial,sans-serif;">strong</span><span style="font-family: helvetica,arial,sans-serif;">
settings makes the filter have a larger impact, whereas </span><span style="font-style: italic; font-family: helvetica,arial,sans-serif;">soft</span><span style="font-family: helvetica,arial,sans-serif;">
is more gentle. In general </span><span style="font-style: italic; font-family: helvetica,arial,sans-serif;">strong</span><span style="font-family: helvetica,arial,sans-serif;">
should give best results on anime, and </span><span style="font-style: italic; font-family: helvetica,arial,sans-serif;">soft</span><span style="font-family: helvetica,arial,sans-serif;">
should be best for filmed material.<br>
<span style="font-style: italic;">SuperSoft / SuperStrong</span> uses a slightly
different approach, and in general leads to fewer artifacts. These two are an
general a bit softer than non-super modes.<br style="font-family: helvetica,arial,sans-serif;">
</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-weight: bold; font-family: helvetica,arial,sans-serif;">downsizer
= &quot;reduce&quot;, &quot;point&quot;, &quot;bilinear&quot;,
&quot;bicubic&quot;, &quot;lanczos&quot; </span><span style="font-style: italic; font-family: helvetica,arial,sans-serif;">-
default: &quot;reduce&quot;</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-weight: bold; font-family: helvetica,arial,sans-serif;">upsizer
= &quot;point&quot;, &quot;bilinear&quot;, &quot;bicubic&quot;,
&quot;lanczos&quot; </span><span style="font-style: italic; font-family: helvetica,arial,sans-serif;">-
default: &quot;bilinear&quot;</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">These two parameters
control how the lower resolution maps are created. There might not be a very big
visual impact, when using different resizers. Experiments are welcome!</span><br style="font-family: helvetica,arial,sans-serif;">
<br style="font-family: helvetica,arial,sans-serif;">
<span style="font-weight: bold; font-family: helvetica,arial,sans-serif;">scalefactor
= 0.5</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">This option sets the
scale of each mipmap. This is how much each frame is reduced in each iteration.
The original resolution is multiplied by this value.&nbsp; Usable values are
from 0.2 to 4.0, however only values between 0.4 and 1.5 are recommended. When
this setting is 1.0 no spatial blurring is done, but this isn't recommended -
use spatial = 0 instead. Experiment with values above 1.0 - they might be
useful.<br>
This affects the radius of the blur. The lower the scalefactor is, the bigger
the radius of the blur - and the more crosstalk you'll get.<br style="font-family: helvetica,arial,sans-serif;">
</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;"><span style="font-family: monospace;">mipsmooth(downsizer=&quot;lanczos&quot;,upsizer=&quot;bilinear&quot;,
scalefactor=1.5, method = &quot;strong&quot;)<br>
<br>
</span>The above script produces very nice gentle smoothing for instance, but is
very slow.<br>
<br style="font-family: helvetica,arial,sans-serif;">
</span><span style="font-weight: bold; font-family: helvetica,arial,sans-serif;">weigh
= true / false</span><br>
<span style="font-family: helvetica,arial,sans-serif;">This option selects
whether mips should be weighed based on how blurred they are.&nbsp; The most
blurred mips are weighed the lowest.&nbsp; This option is equal to &quot;Weighed
Average&quot; in SmoothHiQ, or &quot;soft&quot; matrix in Convolution3D.<br>
<br>
This option has only effect if SuperMip-mode is used.&nbsp; It reduces the
amount of blur when turned on, so it can be used to achieve higher thresholds
without artifacts.<br>
<br>
</span><br>
<span style="font-weight: bold; font-family: helvetica,arial,sans-serif;">show =
true / false</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">Shows information about
scenechange differences, and the settings being used.<br>
This setting will have no effect in RGB24 mode - use RGB32 instead!<br style="font-family: helvetica,arial,sans-serif;">
</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-weight: bold; font-family: helvetica,arial,sans-serif;">storecustom
= true / false</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">This will store the
settings being used in the registry.</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">To reinvoke these presets
later, use preset=&quot;custom&quot; parameter.<br>
This will not automatically become the default parameters.</span><br style="font-family: helvetica,arial,sans-serif;">
</p>
<h2 style="font-family: helvetica,arial,sans-serif;"><small>Presets</small></h2>
<p><font size="-1"><span style="font-family: helvetica,arial,sans-serif;">Presets
are a set of builtin settings to help you get started. The names of the
parameters are not case sensitive.<br>
<br>
All presets are loaded as default values. That means that it is still possible
to finetune preset settings by setting individual parameters.</span><br style="font-family: helvetica,arial,sans-serif;">
<br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">For example: </span><span style="font-style: italic; font-family: helvetica,arial,sans-serif;">MipSmooth(preset
= &quot;movieHQ&quot;, scenechange = 8)</span><span style="font-family: helvetica,arial,sans-serif;">
will use the MovieHQ, but with scenechange set to 8.</span><br style="font-family: helvetica,arial,sans-serif;">
</font></p>
<h4 style="font-family: helvetica,arial,sans-serif;"><font size="-1">MovieHQ</font></h4>
<p style="font-family: helvetica,arial,sans-serif;"><span style="font-family: helvetica,arial,sans-serif;">This
preset is for natual movies in high quality.</span></p>
<pre style="font-family: helvetica,arial,sans-serif;"><span style="font-family: helvetica,arial,sans-serif;"><span style="font-family: monospace;">Spatial: 4</span>
<span style="font-family: monospace;">Temporal: 5</span>
<span style="font-family: monospace;">Spatial Chroma: 5</span>
<span style="font-family: monospace;">Temporal Chroma: 7</span>
<span style="font-family: monospace;">Scenechange: 2.0</span>
<span style="font-family: monospace;">Method: SuperSoft</span>
<span style="font-family: monospace;">Downsizer: Bilinear</span>
<span style="font-family: monospace;">Upsizer: Bilinear</span>
<span style="font-family: monospace;">Scalefactor: 0.85
Weigh = true<small>
</small></span></span></pre>
<h4 style="font-family: helvetica,arial,sans-serif;"><font size="-1">MovieHQ2</font></h4>
<p style="font-family: helvetica,arial,sans-serif;"><span style="font-family: helvetica,arial,sans-serif;">This
preset is for natual movies in high quality.</span></p>
<pre style="font-family: helvetica,arial,sans-serif;"><span style="font-family: helvetica,arial,sans-serif;"><span style="font-family: monospace;">Spatial: 2</span>
<span style="font-family: monospace;">Temporal: 2</span>
<span style="font-family: monospace;">Spatial Chroma: 3</span>
<span style="font-family: monospace;">Temporal Chroma: 3</span>
<span style="font-family: monospace;">Scenechange: 2.5</span>
<span style="font-family: monospace;">Method: SuperSoft</span>
<span style="font-family: monospace;">Downsizer: Bilinear</span>
<span style="font-family: monospace;">Upsizer: Bilinear</span>
<span style="font-family: monospace;">Scalefactor: 0.75
Weigh = true</span></span></pre>
<h4 style="font-family: helvetica,arial,sans-serif;"><small>MovieLQ</small></h4>
<p style="font-family: helvetica,arial,sans-serif;"><span style="font-family: helvetica,arial,sans-serif;">This
preset is for natural movies that need more smoothing, to have more blocks and
noise removed.</span></p>
<pre><span style="font-family: helvetica,arial,sans-serif;"><span style="font-family: monospace;">Spatial: 8</span>
<span style="font-family: monospace;">Temporal: 7</span>
<span style="font-family: monospace;">Spatial Chroma: 10</span>
<span style="font-family: monospace;">Temporal Chroma: 8</span>
<span style="font-family: monospace;">Scenechange: 3.5</span>
<span style="font-family: monospace;">Method: SuperSoft</span>
<span style="font-family: monospace;">Downsizer: Bilinear</span>
<span style="font-family: monospace;">Upsizer: Bilinear</span>
<span style="font-family: monospace;">Scalefactor: 0.65
Weigh = true</span></span>
</pre>
<h4 style="font-family: helvetica,arial,sans-serif;"><small>MovieLQ2</small></h4>
<span style="font-family: helvetica,arial,sans-serif;">This preset is for
natural movies that need more smoothing, to have more blocks and noise removed.</span>
<pre><span style="font-family: helvetica,arial,sans-serif;"><span style="font-family: monospace;">Spatial: 4</span>
<span style="font-family: monospace;">Temporal: 4</span>
<span style="font-family: monospace;">Spatial Chroma: 5</span>
<span style="font-family: monospace;">Temporal Chroma: 5</span>
<span style="font-family: monospace;">Scenechange: 3.5</span>
<span style="font-family: monospace;">Method: SuperStrong</span>
<span style="font-family: monospace;">Downsizer: Bilinear</span>
<span style="font-family: monospace;">Upsizer: Bilinear</span>
<span style="font-family: monospace;">Scalefactor: 0.65
Weigh = true</span></span>

</pre>
<h4 style="font-family: helvetica,arial,sans-serif;"><small>VHS</small></h4>
<pre style="font-family: helvetica,arial,sans-serif;"><span style="font-family: helvetica,arial,sans-serif;"><span style="font-family: monospace;">Spatial: 9</span>
<span style="font-family: monospace;">Temporal: 6</span>
<span style="font-family: monospace;">Spatial Chroma: 10</span>
<span style="font-family: monospace;">Temporal Chroma: 9</span>
<span style="font-family: monospace;">Scenechange: 5.0</span>
<span style="font-family: monospace;">Method: SuperStrong</span>
<span style="font-family: monospace;">Downsizer: Bilinear</span>
<span style="font-family: monospace;">Upsizer: Bilinear</span>
<span style="font-family: monospace;">Scalefactor: 0.60
Weigh = true</span></span>
</pre>
<h4 style="font-family: helvetica,arial,sans-serif;"><small>AnimeHQ</small></h4>
This is for slight blockremoval and gradient restoration. It has more spatial
smoothing than ordinary video to help recreate flat and gradient surfaces.
<pre><span style="font-family: helvetica,arial,sans-serif;"><span style="font-family: monospace;">Spatial: 6</span>
<span style="font-family: monospace;">Temporal: 8</span>
<span style="font-family: monospace;">Spatial Chroma: 6</span>
<span style="font-family: monospace;">Temporal Chroma: 8</span>
<span style="font-family: monospace;">Scenechange: 5.0</span>
<span style="font-family: monospace;">Method: SuperSoft</span>
<span style="font-family: monospace;">Downsizer: Bicubic</span>
<span style="font-family: monospace;">Upsizer: Bicubic</span>
<span style="font-family: monospace;">Scalefactor: 0.60
Weigh = true</span></span>
</pre>
<h4 style="font-family: helvetica,arial,sans-serif;"><small>AnimeLQ</small></h4>
<span style="font-family: helvetica,arial,sans-serif;">This is for more noisy
material with more blocks and noise.</span>
<pre><span style="font-family: helvetica,arial,sans-serif;"><span style="font-family: monospace;">Spatial: 5</span>
<span style="font-family: monospace;">Temporal: 5</span>
<span style="font-family: monospace;">Spatial Chroma: 5</span>
<span style="font-family: monospace;">Temporal Chroma: 7</span>
<span style="font-family: monospace;">Scenechange: 5.5</span>
<span style="font-family: monospace;">Method: SuperStrong</span>
<span style="font-family: monospace;">Downsizer: Bilinear</span>
<span style="font-family: monospace;">Upsizer: Bicubic</span>
<span style="font-family: monospace;">Scalefactor: 0.5
Weigh = true</span></span>
</pre>
<h4 style="font-family: helvetica,arial,sans-serif;"><small>Rainbow</small></h4>
<p style="font-family: helvetica,arial,sans-serif;"><span style="font-family: helvetica,arial,sans-serif;">This
might help removing rainbow flicker. See <a href="http://forum.doom9.org/showthread.php?s=&amp;threadid=62873">this
thread at Doom9</a> for info and alternatives. Reduce scalefactor for even more
rainbow removal, but more chroma blurring.</span></p>
<pre style="font-family: helvetica,arial,sans-serif;"><span style="font-family: helvetica,arial,sans-serif;"><span style="font-family: monospace;">Spatial: 0</span>
<span style="font-family: monospace;">Temporal: 0</span>
<span style="font-family: monospace;">Spatial Chroma: 255</span>
<span style="font-family: monospace;">Temporal Chroma: 255</span>
<span style="font-family: monospace;">Scenechange: 2.0</span>
<span style="font-family: monospace;">Method: SuperStrong</span>
<span style="font-family: monospace;">Downsizer: Bilinear</span>
<span style="font-family: monospace;">Upsizer: Bilinear</span>
<span style="font-family: monospace;">Scalefactor: 0.65
Weigh = true</span></span>
</pre>
<h4 style="font-family: helvetica,arial,sans-serif;"><small>Custom</small></h4>
<font size="-1"><span style="font-family: helvetica,arial,sans-serif;">This will
read settings that has been stored in the registry, and use these as default
settings.<br>
If there is no settings stored in the registry, an error will be thrown.<br style="font-family: helvetica,arial,sans-serif;">
At any time it is possible to use <span style="font-style: italic;">&quot;storecustom=true&quot;</span>
this will then store the current settings in the registry, and these will then
be used as the custom parameters<br>
<br>
</span></font>
<h2><small><span style="font-family: helvetica,arial,sans-serif;">Examples &amp;
Tricks:</span></small></h2>
Try experimenting with quite hard softening with very low thresholds. For
example:<br>
<span style="font-family: monospace;">mipsmooth(spatial=2, temporal=2,
method=&quot;superstrong&quot;, scalefactor=0.75, weigh=true)</span><br style="font-family: monospace;">
This is a quite good setting for high quality material, which will stabilize the
image and give much better compression and still retaining a quite high amount
of detail. These modes are implemented as &quot;MovieHQ2&quot; and
&quot;MovieLQ2&quot; presets.<br>
<br>
<span style="font-family: monospace;">MipSmooth(spatial=255, scenechange=0,
method=&quot;soft&quot;)</span><br style="font-family: monospace;">
This will give a very soft image - seen in some commercials and soap operas.<br>
<br>
<span style="font-family: monospace;">MipSmooth(spatial=255, scenechange=0,
method=&quot;strong&quot;, scalefactor=0.65)</span><br>
This will smooth the image very much like a soft gaussian blur.<br>
<br style="font-family: monospace;">
<span style="font-family: monospace;">MipSmooth(spatial=255, scenechange=255,
temporal=255, method=&quot;superstrong&quot;, scalefactor=0.6, weigh=false)</span><br>
This will also give a very soft image with some temporal blurring.<br>
<br>
When cropping right before this filter, use &quot;align=true&quot; parameter,
available in AviSynth 2.5.3 and later. This will in most cases give a slight
speedup.<br>
<h2 style="font-family: helvetica,arial,sans-serif;"><small>Background
information:</small></h2>
<span style="font-family: helvetica,arial,sans-serif;">&quot;Mip&quot; comes
from &quot;MipMap&quot;, which is a term used in the realtime 3D-graphics world,
and basicly describes a downsampled version of a texture (bitmap surfaces of 3D
objects), that is used, when the object is far away.&nbsp; MipMaps are always
half the size of the original image.</span><br style="font-family: helvetica,arial,sans-serif;">
<br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">What MipSmooth does is
actually very simple:</span><br style="font-family: helvetica,arial,sans-serif;">
<br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">It takes the source
frame, and creates three new versions, each half the size of the previous. This
is done by using </span><span style="font-style: italic; font-family: helvetica,arial,sans-serif;">ReduceBy2</span><span style="font-family: helvetica,arial,sans-serif;">,
or a selectable resizer. These frames are then all scaled back up to original
size using </span><span style="font-style: italic; font-family: helvetica,arial,sans-serif;">BilinearResize</span><span style="font-family: helvetica,arial,sans-serif;">.&nbsp;
These frames are then compared to the original, and if the difference is below
the threshold, the information is used to form the final pixel.</span><br style="font-family: helvetica,arial,sans-serif;">
<br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">The same is done to the
previous and the next frame - and all these three frames and their
&quot;blurred&quot; mipmaps are used to reconstruct each pixel.</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">Threshold is adjusted to
that more blurred images are given a lower threshold than the sharper versions.<br>
<br>
Supermip first creates three frames (supermips) from spatially blurred images
and does a temporal softening on these three framres. This greatly reduces
artifacts on heavy denoising/blurring.<br style="font-family: helvetica,arial,sans-serif;">
</span><br style="font-family: helvetica,arial,sans-serif;">
<span style="font-family: helvetica,arial,sans-serif;">Further possible
improvements:</span><br style="font-family: helvetica,arial,sans-serif;">
<ul style="font-family: helvetica,arial,sans-serif;">
  <li>Adjustable number of mips.</li>
  <li>Image examples in documentation.</li>
  <li>GUI.<small><br>
    </small></li>
</ul>
</body>
</html>
